#pragma once

#include <string>
#include <map>
#include <list>
#include <vector>
#include "sms_msg_define.h"


class sms_ui_data_mgr
{
public:
	typedef std::map< int , roof_info_t_ > sms_ui_roof_map;
	typedef std::map< std::string , sms_linkman_info_t_ > sms_linkman_map;
	typedef std::map< int , std::string >                 sms_linkman_userid_map;   
public:
	sms_ui_data_mgr(void);
	~sms_ui_data_mgr(void);
	BOOL init_data();
public:
	bool clear_roof_map();
	bool clear_linkman_map();
	bool clear_linkman_index_map();
	bool insert_data_to_roof_map(roof_info_t_ & r);
	bool insert_to_search_map( const char * userid_,const char * nickname_,const char * number_ );

	int  get_linkman_index_count();
	int  get_ui_linkman_count();
	bool init_ui_linkman_map();
	bool get_linkman_by_idx(int idx ,sms_linkman_info_t_ &t);

private:
	bool read_from_enterprise();
	bool read_from_buddy();
	bool read_from_contact();
	bool read_from_curr_user();
	bool find_from_linkman_map(const char * key);
	bool find_from_linkman_index_map(int idx );
public:
   sms_ui_roof_map		ui_roof_map;

   sms_linkman_map       ui_linkman_map_;
   sms_linkman_userid_map    ui_linkman_userid_map_;

   aot::data::icontact_op* db_contact_op_;
   aot::glb::ienterprise * enterprise_obj_ptr_;
};
